package com.qidian.client;

import org.apache.log4j.Logger;

public class TransMessageBean 
{
	static Logger logger = Logger.getLogger(TransMessageBean.class) ;
    // 消息ID
    String id = null;
    String tid = null ;
    
    // 回答的客户端ID;
    Long clientId = -1L;
    
    // 项目类型
    int gameType = -1;
    // 超时时间
    int interval = -1;
    // 接收时间
    long receiveTime = -1;
    // 转发时间
    long answerTime = -1;
    // 服务器应答时间
    long responseTime = -1;
  
    // 消息的状态
    volatile int status = 0;
    // 答案
    volatile String answer = null;

//    // 内容
//    byte[] content = null;
    // 内容类型
    String contentType = null;
    // 文件路径
    String filePath = null ;
    
    // 转发的平台
    BaseTranser transer = null ;
    
    // 状态转移时间
    long fetchTime = -1L ;
    long sendFileTime = -1L ;
    long getAnswerTime = -1L ;
    long sendAnswerTime = -1L ; 
    
    String other = null ;
    
    
    public String getOther() {
		return other;
	}


	public void setOther(String other) {
		this.other = other;
	}


	public TransMessageBean()
    {
    	
    }
    
    public boolean isTimeout()
    {
    	return (System.currentTimeMillis()-this.fetchTime) > this.interval*1000*1.5 ;
    }
    
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Long getClientId() {
		return clientId;
	}
	public void setClientId(Long clientId) {
		this.clientId = clientId;
	}
	public int getGameType() {
		return gameType;
	}
	public void setGameType(int gameType) {
		this.gameType = gameType;
	}
	public int getInterval() {
		return interval;
	}
	public void setInterval(int interval) {
		this.interval = interval;
	}
	public long getReceiveTime() {
		return receiveTime;
	}
	public void setReceiveTime(long receiveTime) {
		this.receiveTime = receiveTime;
	}
	public long getAnswerTime() {
		return answerTime;
	}
	public void setAnswerTime(long answerTime) {
		this.answerTime = answerTime;
	}
	public long getResponseTime() {
		return responseTime;
	}
	public void setResponseTime(long responseTime) {
		this.responseTime = responseTime;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public String getAnswer() {
		return answer;
	}
	public void setAnswer(String answer) {
		this.answer = answer;
	}
//	public byte[] getContent() {
//		return content;
//	}
//	public void setContent(byte[] content) {
//		this.content = content;
//	}
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	public String getTid() {
		return tid;
	}
	public void setTid(String tid) {
		this.tid = tid;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	
	public String toString()
	{
		return "msgId:"+id+",tid:"+tid+",answer:"+answer+",fetch time:"+ fetchTime+",send file time:"+sendFileTime
			+",get answer time:"+getAnswerTime+", send answer time:"+ sendAnswerTime + ",file path:"+filePath;
	}

	public BaseTranser getTranser() {
		return transer;
	}

	public void setTranser(BaseTranser transer) {
		this.transer = transer;
	}


	public long getFetchTime() {
		return fetchTime;
	}


	public void setFetchTime(long fetchTime) {
		this.fetchTime = fetchTime;
	}


	public long getSendFileTime() {
		return sendFileTime;
	}


	public void setSendFileTime(long sendFileTime) {
		this.sendFileTime = sendFileTime;
	}


	public long getGetAnswerTime() {
		return getAnswerTime;
	}


	public void setGetAnswerTime(long getAnswerTime) {
		this.getAnswerTime = getAnswerTime;
	}


	public long getSendAnswerTime() {
		return sendAnswerTime;
	}


	public void setSendAnswerTime(long sendAnswerTime) {
		this.sendAnswerTime = sendAnswerTime;
	}
}
